package com.tuanzi.loan.business.service.settlement.impl;

import com.tuanzi.loan.business.entity.settlement.QualificationInfo;
import com.tuanzi.loan.business.repository.settlement.QualificationInfoRepository;
import com.tuanzi.loan.business.service.settlement.QualificationInfoService;
import com.tuanzi.loan.core.aspect.Debug;
import com.tuanzi.loan.core.service.CommonServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.retry.RetryException;
import org.springframework.retry.annotation.Retryable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @author caiwanlin
 * @create 2018-01-12 11:31
 */
@Debug
@Service
@Transactional
@Retryable(value = { RetryException.class })
public class QualificationInfoServiceImpl extends CommonServiceImpl<QualificationInfo,Long> implements QualificationInfoService {
    @Autowired
    private QualificationInfoRepository qualificationInfoRepository;
    @Override
    protected JpaRepository<QualificationInfo, Long> getRepository() {
        return qualificationInfoRepository;
    }

    @Override
    public List<QualificationInfo> findAllByCompanyId(Long companyId) {
        return qualificationInfoRepository.findAllByCompanyId(companyId);
    }
}
